﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Windows.Input
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System;
using System.Runtime.CompilerServices;
using UnityEngine.Bindings;

#nullable disable
namespace UnityEngine.Windows
{
  /// <summary>
  ///   <para>Provides static methods for Windows specific input manipulation.</para>
  /// </summary>
  [NativeHeader("PlatformDependent/Win/Bindings/InputBindings.h")]
  public static class Input
  {
    [ThreadSafe]
    [NativeName("ForwardRawInput")]
    [StaticAccessor("", StaticAccessorType.DoubleColon)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern unsafe void ForwardRawInputImpl(
      uint* rawInputHeaderIndices,
      uint* rawInputDataIndices,
      uint indicesCount,
      byte* rawInputData,
      uint rawInputDataSize);

    /// <summary>
    ///   <para>Forwards raw input events to Unity.</para>
    /// </summary>
    /// <param name="rawInputHeaderIndices">Pointer to array of indices that specify the byte offsets of RAWINPUTHEADER structures in rawInputData.</param>
    /// <param name="rawInputDataIndices">Pointer to array of indices that specify the byte offsets of RAWINPUT::data field in rawInputData.</param>
    /// <param name="indicesCount">Number of RAWINPUT events.</param>
    /// <param name="rawInputData">Pointer to byte array containing RAWINPUT events.</param>
    /// <param name="rawInputDataSize">RawInputData array size in bytes.</param>
    public static unsafe void ForwardRawInput(
      IntPtr rawInputHeaderIndices,
      IntPtr rawInputDataIndices,
      uint indicesCount,
      IntPtr rawInputData,
      uint rawInputDataSize)
    {
      Input.ForwardRawInput((uint*) (void*) rawInputHeaderIndices, (uint*) (void*) rawInputDataIndices, indicesCount, (byte*) (void*) rawInputData, rawInputDataSize);
    }

    /// <summary>
    ///   <para>Forwards raw input events to Unity.</para>
    /// </summary>
    /// <param name="rawInputHeaderIndices">Pointer to array of indices that specify the byte offsets of RAWINPUTHEADER structures in rawInputData.</param>
    /// <param name="rawInputDataIndices">Pointer to array of indices that specify the byte offsets of RAWINPUT::data field in rawInputData.</param>
    /// <param name="indicesCount">Number of RAWINPUT events.</param>
    /// <param name="rawInputData">Pointer to byte array containing RAWINPUT events.</param>
    /// <param name="rawInputDataSize">RawInputData array size in bytes.</param>
    public static unsafe void ForwardRawInput(
      uint* rawInputHeaderIndices,
      uint* rawInputDataIndices,
      uint indicesCount,
      byte* rawInputData,
      uint rawInputDataSize)
    {
      if ((IntPtr) rawInputHeaderIndices == IntPtr.Zero)
        throw new ArgumentNullException(nameof (rawInputHeaderIndices));
      if ((IntPtr) rawInputDataIndices == IntPtr.Zero)
        throw new ArgumentNullException(nameof (rawInputDataIndices));
      if ((IntPtr) rawInputData == IntPtr.Zero)
        throw new ArgumentNullException(nameof (rawInputData));
      Input.ForwardRawInputImpl(rawInputHeaderIndices, rawInputDataIndices, indicesCount, rawInputData, rawInputDataSize);
    }
  }
}
